package com.penglecode.dp.structural.proxy;

/**
 * 动态代理
 * 
 * @author pengpeng
 * @date 2013-6-18下午3:22:47
 * @version 1.0
 * @see [相关类/方法]
 * @since [产品/模块版本]
 */
public class JdkProxyTest {

	public static void main(String[] args) {
		User user = new User();
		user.setUserId(10001l);
		user.setUserName("jack");
		user.setPassword("123456");
		user.setMobilePhone("13812345678");
		UserService target = new UserServiceImpl();
		UserService userService = new JdkProxy(target).getProxy();
		System.out.println("target obj = " + target);
		System.out.println("proxy obj = " + userService);
		System.out.println(target == userService);
		userService.registerUser(user);
	}

}
